/*
 * @Author: your name
 * @Date: 2021-07-07 15:01:29
 * @LastEditTime: 2022-04-06 18:44:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \exc-tl1-2\SRC\user_src\sensor.h
 */
/**
	*文件名称：
	*
	*文件日期：
	*
	*文件描述：
	*
	*文件版本：V1.0
	*
	*/

#ifndef SENSOR_H
#define SENSOR_H

/* 头文件包含区	*/
#include "include.h"
/* 类型声明区 */
typedef struct
{
	u16 reg_addr;
	u16 len;
} alarm_struct;

typedef struct
{
	u16 		intt_cycle;
	u16 		intt_time;
	__IO u16  	cnt_time;
	u16		    cnt_write_flag;
	uint8_t		send_lamp1_time_flag;
	uint8_t	 	send_lamp2_time_flag;
	uint16_t	delay_send_time;
	uint32_t	currut_lamp1_on_timestamp;
	uint32_t	currut_lamp2_on_timestamp;	
	uint32_t	system_run_timestamp;	//系统运行时间戳	
	uint8_t 	time_on;
} leakageDetection;
extern leakageDetection leakDete;
/* 宏定义区 */

/* 函数声明区 */
void get_sensor(void);
void reportAlarmData(const uint16_t *alarm, const uint16_t *lastAlarm);
void sensor_init(void);
void alarm_check(void);
int16_t get_temp(void);
void fnFront_ClockBatCalculate(void);
void intt_cycle_add(void);
#endif
